#pragma once

#include <windows.h>
#include <fstream>
#include <gdiplus.h>

#pragma comment (lib,"Gdiplus.lib")

#include "../geometry/grid.h"

enum move_kind_t
{
	LEFT_M,
	RIGHT_M,
	TOP_M,
	BOTTOM_M
};

class drawer_t
{
public:
	drawer_t();
	drawer_t(Gdiplus::Graphics * g);
	void increase();
	void decrease();
	void clear();
	void paint();	
	void move(move_kind_t where_to_move);

private:

	Gdiplus::Graphics * graphics_;
	unsigned num_cells_;
	double v_position_;
	double h_position_;
	polygon_t polygon_;
	grid_t<> grid_;
	unsigned current_area_;

	point_t scale_point(point_t const & point) const;
	void paint_polygon();
	void paint_cells();
};